package com.app.util.memcached;

public class MemCachedPoolConf {

	String[] servers;
	Integer[] weights;
	int initConn = 5;
	int minConn = 5;
	int maxConn = 256;
	int maxIdle = 1000 * 60 * 60;
	int maintSleep = 30;
	boolean nagle = false;
	int socketTO = 30;
	int socketConnectTO = 30;

	boolean primitiveAsString;

	public MemCachedPoolConf() {
	}

	public void setServers(String[] servers) {
		this.servers = servers; 
	}

	public void setWeights(Integer[] weights) {
		this.weights = weights;
	}

	public void setServersString(String servers) {
		this.servers = servers.split(",");
	}

	public void setWeightsString(String weights) {
		String[] ss = weights.split(",");
		Integer[] ws = new Integer[ss.length];
		for (int i = 0; i < ss.length; i++) {
			ws[i] = Integer.parseInt(ss[i]);
		}
		this.weights = ws;
	}

	public String[] getServers() {
		return servers;
	}

	public Integer[] getWeights() {
		return weights;
	}

	public int getInitConn() {
		return initConn;
	}

	public void setInitConn(int initConn) {
		this.initConn = initConn;
	}

	public int getMinConn() {
		return minConn;
	}

	public void setMinConn(int minConn) {
		this.minConn = minConn;
	}

	public int getMaxConn() {
		return maxConn;
	}

	public void setMaxConn(int maxConn) {
		this.maxConn = maxConn;
	}

	public int getMaxIdle() {
		return maxIdle;
	}

	public void setMaxIdle(int maxIdle) {
		this.maxIdle = maxIdle;
	}

	public int getMaintSleep() {
		return maintSleep;
	}

	public void setMaintSleep(int maintSleep) {
		this.maintSleep = maintSleep;
	}

	public boolean isNagle() {
		return nagle;
	}

	public boolean isPrimitiveAsString() {
		return primitiveAsString;
	}

	public void setPrimitiveAsString(boolean primitiveAsString) {
		this.primitiveAsString = primitiveAsString;
	}

	public void setNagle(boolean nagle) {
		this.nagle = nagle;
	}

	public int getSocketTO() {
		return socketTO;
	}

	public void setSocketTO(int socketTO) {
		this.socketTO = socketTO;
	}

	public int getSocketConnectTO() {
		return socketConnectTO;
	}

	public void setSocketConnectTO(int socketConnectTO) {
		this.socketConnectTO = socketConnectTO;
	}

}